<?php
//CONTROLLERS
include_once 'application/controllers/LoginController.php';

class LoginView {

    public function render() {
	    $this->renderContent();
    }

    public function renderContent() {
    
    	?>
		<!-- AUTHENTIFICATION AREA -->
        <div>
	        <form id="login" method="post" action="index.php">
	            <h1>Authentification</h1>
	            <fieldset id="inputs">
	                <input id="username" name="username" type="text" placeholder="Login" autofocus required>      
	                <input id="password" name="password" type="password" placeholder="Mot de passe" required>
	            </fieldset>
	            <fieldset id="actions">
	                <input type="submit" id="submit" value="Se connecter">
	                <a href="index.php?page=0">Mot de passe oubli&eacute; ?</a>
	            </fieldset>
	        </form>
        </div>
        <!-- END AUTHENTIFICATION AREA -->

        <?php
        //'; 

    }
    
    public function renderLostPassword() {
    	
    	$result = LoginController::getResultLostPassword();
    	
    	if($result == null) 
            $result = "Le mot de passe vous sera envoy&eacute; par l'administrateur du projet.";
    	
    	?>
    	<!-- LOST PASSWORD AREA -->
        <div>
	        <form id="login" method="post" action="index.php?page=0">
	            <h1>Authentification</h1>
	            <fieldset id="inputs">
	            	<label id="result"><?php echo $result; ?></label>
	                <input id="loginOrEmail" name="loginOrEmail" type="text" placeholder="Login utilisé" autofocus required>
                        <input id="userEmail" name="userEmail" type="text" placeholder="Votre adresse mail" autofocus required>
	            </fieldset>
	            <fieldset id="actions">
	                <input type="submit" id="submit" value="Valider">
	                <a href="index.php">Retour &agrave; l'authentification</a>
	            </fieldset>
	        </form>
        </div>
        <!-- END LOST PASSWORD AREA -->
        
    	<?php
    }
    
}

?>
